home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 386 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  1.4 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 6c 61 6e 67 2e 63 2b | 2b 0a 50 61 74 68 3a 20 |.lang.c+|+.Path: |
|00000020| 74 65 6c 65 70 6f 73 74 | 2e 6e 6f 21 73 74 61 74 |telepost|.no!stat|
|00000030| 6f 69 6c 21 75 73 65 6e | 65 74 0a 46 72 6f 6d 3a |oil!usen|et.From:|
|00000040| 20 42 6a 6f 72 6e 20 54 | 68 6f 6d 61 73 73 65 6e | Bjorn T|homassen|
|00000050| 20 3c 6b 6f 6e 62 6f 74 | 40 53 54 2e 53 74 61 74 | <konbot|@ST.Stat|
|00000060| 6f 69 6c 2e 6e 6f 74 65 | 73 2e 74 65 6c 65 6d 61 |oil.note|s.telema|
|00000070| 78 3e 0a 53 75 62 6a 65 | 63 74 3a 20 52 65 3a 20 |x>.Subje|ct: Re: |
|00000080| 55 73 69 6e 67 20 42 43 | 34 2e 35 20 54 41 72 72 |Using BC|4.5 TArr|
|00000090| 61 79 41 73 56 65 63 74 | 6f 72 20 6f 66 20 6d 79 |ayAsVect|or of my|
|000000a0| 20 63 6c 61 73 73 20 69 | 6e 20 61 20 63 6c 61 73 | class i|n a clas|
|000000b0| 73 21 0a 43 6f 6e 74 65 | 6e 74 2d 54 79 70 65 3a |s!.Conte|nt-Type:|
|000000c0| 20 74 65 78 74 2f 70 6c | 61 69 6e 3b 20 63 68 61 | text/pl|ain; cha|
|000000d0| 72 73 65 74 3d 75 73 2d | 61 73 63 69 69 0a 4d 65 |rset=us-|ascii.Me|
|000000e0| 73 73 61 67 65 2d 49 44 | 3a 20 3c 31 39 39 36 4a |ssage-ID|: <1996J|
|000000f0| 61 6e 34 2e 30 38 34 35 | 34 32 2e 37 32 32 39 40 |an4.0845|42.7229@|
|00000100| 73 74 61 74 6f 69 6c 2e | 6e 6f 3e 0a 54 6f 3a 20 |statoil.|no>.To: |
|00000110| 5c 50 3d 69 6e 74 65 72 | 6e 65 74 5c 41 3d 74 65 |\P=inter|net\A=te|
|00000120| 6c 65 6d 61 78 5c 43 3d | 6e 6f 5c 44 3d 52 46 43 |lemax\C=|no\D=RFC|
|00000130| 2d 38 32 32 5e 62 65 73 | 65 63 40 77 6d 69 6e 2e |-822^bes|ec@wmin.|
|00000140| 61 63 2e 75 6b 40 58 34 | 30 30 2c 40 2c 54 45 4c |ac.uk@X4|00,@,TEL|
|00000150| 45 4d 41 58 2c 40 2c 44 | 4e 53 4f 0a 53 65 6e 64 |EMAX,@,D|NSO.Send|
|00000160| 65 72 3a 20 75 73 65 6e | 65 74 40 73 74 61 74 6f |er: usen|et@stato|
|00000170| 69 6c 2e 6e 6f 0a 4e 6e | 74 70 2d 50 6f 73 74 69 |il.no.Nn|tp-Posti|
|00000180| 6e 67 2d 48 6f 73 74 3a | 20 31 34 33 2e 39 37 2e |ng-Host:| 143.97.|
|00000190| 31 30 38 2e 31 35 36 0a | 43 6f 6e 74 65 6e 74 2d |108.156.|Content-|
|000001a0| 54 72 61 6e 73 66 65 72 | 2d 45 6e 63 6f 64 69 6e |Transfer|-Encodin|
|000001b0| 67 3a 20 37 62 69 74 0a | 4f 72 67 61 6e 69 7a 61 |g: 7bit.|Organiza|
|000001c0| 74 69 6f 6e 3a 20 44 65 | 6c 66 69 20 44 61 74 61 |tion: De|lfi Data|
|000001d0| 20 41 53 0a 52 65 66 65 | 72 65 6e 63 65 73 3a 20 | AS.Refe|rences: |
|000001e0| 3c 44 4b 4d 48 4a 45 2e | 42 30 42 40 77 65 73 74 |<DKMHJE.|B0B@west|
|000001f0| 6d 69 6e 73 74 65 72 2e | 61 63 2e 75 6b 3e 0a 4d |minster.|ac.uk>.M|
|00000200| 69 6d 65 2d 56 65 72 73 | 69 6f 6e 3a 20 31 2e 30 |ime-Vers|ion: 1.0|
|00000210| 0a 44 61 74 65 3a 20 54 | 68 75 2c 20 34 20 4a 61 |.Date: T|hu, 4 Ja|
|00000220| 6e 20 31 39 39 36 20 30 | 38 3a 34 35 3a 34 32 20 |n 1996 0|8:45:42 |
|00000230| 47 4d 54 0a 58 2d 4d 61 | 69 6c 65 72 3a 20 4d 6f |GMT.X-Ma|iler: Mo|
|00000240| 7a 69 6c 6c 61 20 31 2e | 31 4e 4f 56 20 28 57 69 |zilla 1.|1NOV (Wi|
|00000250| 6e 64 6f 77 73 3b 20 49 | 3b 20 31 36 62 69 74 29 |ndows; I|; 16bit)|
|00000260| 0a 0a 54 68 65 20 73 6f | 6c 75 74 69 6f 6e 20 74 |..The so|lution t|
|00000270| 6f 20 79 6f 75 72 20 70 | 72 6f 62 6c 65 6d 20 69 |o your p|roblem i|
|00000280| 73 20 74 68 61 74 20 61 | 6e 20 69 6e 73 74 61 6e |s that a|n instan|
|00000290| 63 65 20 6f 66 20 54 53 | 41 72 72 61 79 41 73 56 |ce of TS|ArrayAsV|
|000002a0| 65 63 74 6f 72 20 6e 65 | 65 64 73 20 61 74 20 6c |ector ne|eds at l|
|000002b0| 65 61 73 74 20 0a 6f 6e | 65 20 61 72 67 75 6d 65 |east .on|e argume|
|000002c0| 6e 74 20 28 75 70 70 65 | 72 29 20 74 6f 20 62 65 |nt (uppe|r) to be|
|000002d0| 20 63 6f 6e 73 74 72 75 | 63 74 65 64 2e 20 54 6f | constru|cted. To|
|000002e0| 20 6d 61 6b 65 20 69 74 | 20 64 79 6e 61 6d 69 63 | make it| dynamic|
|000002f0| 61 6c 2c 20 79 6f 75 20 | 6e 65 65 64 20 74 6f 20 |al, you |need to |
|00000300| 70 72 6f 76 69 64 65 20 | 0a 61 6c 6c 20 74 68 72 |provide |.all thr|
|00000310| 65 65 20 61 72 67 75 6d | 65 6e 74 73 3a 20 75 70 |ee argum|ents: up|
|00000320| 70 65 72 2c 20 6c 6f 77 | 65 72 2c 20 64 65 6c 74 |per, low|er, delt|
|00000330| 61 20 3a 0a 0a 0a 50 61 | 63 6b 3a 3a 50 61 63 6b |a :...Pa|ck::Pack|
|00000340| 28 29 20 3a 20 70 61 63 | 6b 28 35 32 29 0a 7b 0a |() : pac|k(52).{.|
|00000350| 20 20 20 20 20 20 20 20 | 43 61 72 64 20 63 61 72 | |Card car|
|00000360| 64 3b 0a 20 20 20 20 20 | 20 20 20 53 55 49 54 20 |d;. | SUIT |
|00000370| 73 75 69 74 3b 0a 20 20 | 20 20 20 20 20 20 52 41 |suit;. | RA|
|00000380| 4e 4b 20 72 61 6e 6b 3b | 0a 0a 20 20 20 20 20 20 |NK rank;|.. |
|00000390| 20 20 4e 75 6d 62 65 72 | 4f 66 43 61 72 64 73 3d | Number|OfCards=|
|000003a0| 30 3b 0a 0a 20 20 20 20 | 20 20 20 20 66 6f 72 28 |0;.. | for(|
|000003b0| 73 75 69 74 3d 63 6c 75 | 62 73 3b 73 75 69 74 3c |suit=clu|bs;suit<|
|000003c0| 3d 73 70 61 64 65 73 3b | 73 75 69 74 2b 2b 29 0a |=spades;|suit++).|
|000003d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000003e0| 66 6f 72 28 72 61 6e 6b | 3d 74 77 6f 3b 72 61 6e |for(rank|=two;ran|
|000003f0| 6b 3c 3d 61 63 65 3b 72 | 61 6e 6b 2b 2b 29 0a 20 |k<=ace;r|ank++). |
|00000400| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000410| 20 20 20 20 20 20 20 7b | 0a 20 20 20 20 20 20 20 | {|. |
|00000420| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000430| 20 20 20 20 20 20 20 20 | 20 63 61 72 64 2e 53 65 | | card.Se|
|00000440| 74 53 75 69 74 28 73 75 | 69 74 29 3b 0a 20 20 20 |tSuit(su|it);. |
|00000450| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000460| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 63 61 72 | | car|
|00000470| 64 2e 53 65 74 52 61 6e | 6b 28 72 61 6e 6b 29 3b |d.SetRan|k(rank);|
|00000480| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00000490| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000004a0| 20 63 61 72 64 2e 53 65 | 74 46 61 63 65 28 64 6f | card.Se|tFace(do|
|000004b0| 77 6e 29 3b 0a 20 20 20 | 20 20 20 20 20 20 20 20 |wn);. | |
|000004c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000004d0| 20 20 20 20 20 41 64 64 | 43 61 72 64 28 63 61 72 | Add|Card(car|
|000004e0| 64 29 3b 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |d);. | |
|000004f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000500| 20 20 20 20 4e 75 6d 62 | 65 72 4f 66 43 61 72 64 | Numb|erOfCard|
|00000510| 73 2b 2b 3b 0a 20 20 20 | 20 20 20 20 20 20 20 20 |s++;. | |
|00000520| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 7d 0a 7d | | }.}|
|00000530| 0a 0a 0a 0a 41 73 20 79 | 6f 75 20 63 61 6e 20 73 |....As y|ou can s|
|00000540| 65 65 2c 20 6a 75 73 74 | 20 61 64 64 20 27 3a 20 |ee, just| add ': |
|00000550| 70 61 63 6b 28 35 32 29 | 27 20 61 74 20 74 68 65 |pack(52)|' at the|
|00000560| 20 65 6e 64 20 6f 66 20 | 74 68 65 20 66 75 6e 63 | end of |the func|
|00000570| 74 69 6f 6e 20 64 65 66 | 69 6e 69 74 69 6f 6e 20 |tion def|inition |
|00000580| 68 65 61 64 65 72 0a 0a | |header..| |
+--------+-------------------------+-------------------------+--------+--------+